
import 'package:flutter/material.dart';

class TreeNodeData{

  //级别
  int level;
  //是否展开
  bool expaned;
  //是否选中
  bool isSelect = false;
  //子节点
  List<TreeNodeData> children;

  //标题
  String title;
  String leading;
  String trailing;
  //其他扩展数据
  Object extData;

  TreeNodeData({
    this.level = 0,
    this.expaned = false,
    this.isSelect = false,
    this.children = const [],
    this.title = "",
    this.leading = "",
    this.trailing = "",
    this.extData
});

  TreeNodeData.fromJson(Map json,Function func) {

    if(json == null){
      return;
    }
    func(this);
  }

}